<html>
<head>
<script type="text/javascript" src="./xmlrpc.js"></script>
<script type="text/javascript" src="./util.js"></script>
<script type="text/javascript" src="./jquery.js"></script>
<script>
function httpGet(url, charset, callback) {
        var xhr = new XMLHttpRequest();
        xhr.onreadystatechange = function() {
                if (xhr.readyState == 4) {
                        if (xhr.status == 200) {
								alert('this is ' + xhr.responseText);
                        } else {
                                alert('this is null');
                        }
                }
        }
        xhr.open('GET', url, true);
        xhr.overrideMimeType('text/plain; charset=' + charset);
        xhr.send();
}

function callback(req){
	alert(req);
}

function callbackfail(status,error){
	alert(status + error);
}

chrome.browserAction.onClicked.addListener(
	function(tab) {
	//httpGet('http://php8848.appspot.com/rpc','utf-8',null);
	//var xml = XMLRPC_LIB.makeXML('demo.sayHello',[]);
	var xml = XMLRPC_LIB.makeXML('nuoqiu.StoryPost.1',['zhangtian','tianhe','2010-12-23']);
	XMLRPC_LIB.doCommand('http://php8848.appspot.com/rpc',xml,callback,callbackfail);
	}
);
</script>
</head>
</html>
